import request from '@/utils/request'
const baseUrl = '/user'

export function reqUserPage(pageNum, pageSize, queryParams) {
    let query = {
        pageNum,
        pageSize,
        ...queryParams
    }
    return request({
        url: `${baseUrl}`,
        method: 'get',
        params: query
    })
}

export function reqUpdateAndAddUser(data) {
    return request({
        url: `${baseUrl}`,
        method: 'post',
        data: data
    })
}

export function reqDeleteUser(ids) {
    return request({
        url: `${baseUrl}/${ids}`,
        method: 'delete',
    })
}
export function reqChangeUserStatus(userId, val) {
    let params = {
        val,
        userId
    }
    return request({
        url: `${baseUrl}/changeStatus`,
        method: 'get',
        params
    })
}
